#include "curl_post_to_bottle.hpp"
#include <iostream>

int main()
{
        CCurlPostToBottle post_client;
        if (!post_client.init()) {
                std::cout << "post client init failed." << std::endl;
        }
        else {
                std::string str_post_data;
                str_post_data = "{\"name\": \"tom\", \"age\": 3}";
                if (post_client.post(str_post_data)) {
                        std::cout << "post data to server succeed." << std::endl;
                }
                else {
                        std::cout << "post data to server failed." << std::endl;
                }

                str_post_data = "{\"name\": \"jerry\", \"age\": 5}";
                if (post_client.post(str_post_data)) {
                        std::cout << "post data to server succeed." << std::endl;
                }
                else {
                        std::cout << "post data to server failed." << std::endl;
                }
        }
        system("pause");
        return 0;
}